package listener;

import dao.TableUsingDaoImpl;
import dao.UsingDaoImpl;
import utils.string.session.SessionStringUtil;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import java.util.HashMap;

public class AllUsingListener implements HttpSessionListener {
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        TableUsingDaoImpl tableUsingDao = new TableUsingDaoImpl();
        HashMap usings = tableUsingDao.selectAll();
        HttpSession session = se.getSession();
        session.setAttribute(SessionStringUtil.ALL_USING,usings);
    }
}
